<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* 最大值 最小值 绝对值 */
        console.log(Math.max(3,4,5));//5
        console.log(Math.min(3,4,5));//3
        console.log(Math.abs(5));
        console.log(Math.abs(-5));

        /* 舍入 */
        console.log(Math.floor(3.5));//3
        console.log(Math.floor(-3.5));//-4
        console.log(Math.ceil(3.5));//4
        console.log(Math.ceil(-3.5));//-3
        console.log(Math.round(3.4));//3
        console.log(Math.round(3.5));//4
        console.log(Math.round(-3.4));//-3
        console.log(Math.round(-3.6));//-4

        /* 乘方与开方 */
        console.log(Math.pow(2,3));//8
        console.log(Math.pow(2,0));//1
        console.log(Math.pow(9,1/2));//3
        console.log(Math.pow(8,1/3));//2
        console.log(Math.pow(16,1/4));//2
        // 求16的平方根（square root）
        console.log(Math.sqrt(16));//4
        // 8的立方根 cubic root
        console.log(Math.cbrt(8));//2

        /* 三角函数 */
        // 正弦
        console.log(Math.sin((30/180)*Math.PI));
        // 余弦
        console.log(Math.cos((30/180)*Math.PI));
        // 正切
        console.log(Math.tan((30/180)*Math.PI));
    </script>
</body>
</html>